// 2005 Recoding

global keepers2005 ""

numlabel, add

genl id=serialno
global keepers2005 $keepers2005 id

genl year=2005
global keepers2005 $keepers2005 year

genl wt=postwtbr
global keepers2005 $keepers2005 wt

genl income=tq84
recode income 98/9999=.
genl income3=income
centile income, c(33 66 100)
replace income3=0 if income<=r(c_1)
centile income, c(33 66 100)
replace income3=1 if income>r(c_1) & income<=r(c_2)
centile income, c(33 66 100)
replace income3=2 if income>r(c_2) & income<=r(c_3)
global keepers2005 $keepers2005 income3

genl pid=bq9ax
replace pid=bq9ay if pid==. & bq9ay~=.
gen pid_ce=pid
recode pid_ce 2/99=0
global keepers2005 $keepers2005 pid_ce

genl turnout=bq12a
recode turnout 2 9=0
global keepers2005 $keepers2005 turnout

genl vote_ce=bq12b
recode vote_ce 2/99=0
global keepers2005 $keepers2005 vote_ce


// Campaign Interest

codebook bq10
gen intcampnew = bq10
recode intcampnew 98=2.5 99=. 
replace intcampnew=(abs(intcampnew-4))/3
label variable intcampnew "campaing interest new"
label define campinterest 1 "1=high interest"
label values intcampnew campinterest
tab bq10 intcampnew
global keepers2005 $keepers2005 intcampnew

codebook bq60
gen attnpolsnew = bq60
recode attnpolsnew 98=5 99=.
replace attnpolsnew = attnpolsnew/10
tab attnpolsnew bq60
label variable attnpolsnew "attention to politics new"
label values attnpolsnew campinterest
tab bq60 attnpolsnew
global keepers2005 $keepers2005 attnpolsnew

codebook bq1
gen intpolsnew = bq1
recode intpolsnew 9=.
replace intpolsnew=(abs(intpolsnew-5))/4
label variable intpolsnew "interest in pols"
label define interest 1 "1=high interest"
label values intpolsnew interest
tab bq1 intpolsnew
global keepers2005 $keepers2005 intpolsnew

codebook bq49i
gen ftrptyworknew = bq49i
recode ftrptyworknew 98=5 99=.
replace ftrptyworknew = ftrptyworknew/10
tab ftrptyworknew bq49i
label variable ftrptyworknew "will work for party new"
label define wrk 1 "1=will work for party"
label values ftrptyworknew wrk
tab bq49i ftrptyworknew
global keepers2005 $keepers2005 ftrptyworknew

gen ptymembnew = bq54a
recode ptymembnew 1=1 2=0 9=.5
label variable ptymembnew "party membership new"
label define membr 1 "1=member"
label values ptymembnew membr
tab ptymembnew bq54a
global keepers2005 $keepers2005 ptymembnew


// Media Exposure

codebook bq68a
gen npexpnew = bq68a
recode npexpnew 1=1 2=0
label variable npexpnew "reads newspaper new"
label define reads 1 "1=reads np"
label values npexpnew reads
tab bq68a npexpnew
global keepers2005 $keepers2005 npexpnew

codebook bq73
gen netfollownew = bq73
replace netfollownew = (abs(netfollownew-4))/3
label variable netfollownew "followed campaign on tv new"
label define foll 1 "1=followed"
label values netfollownew foll
tab bq73 netfollownew
global keepers2005 $keepers2005 netfollownew


// Ideology

codebook bq38a
gen taxspendnew = bq38a
replace taxspendnew=taxspendnew/10
label variable taxspendnew "social spending new"
label define spend 1 "1=pro-spending" 
label values taxspendnew spend
tab taxspendnew
tab bq38a
global keepers2005 $keepers2005 taxspendnew




// Class/occupation

// Assuming that husband is "head of household"
*gen class_head_grade = 
*recode class_head_grade 0=.
label define LblClassOcc 1 "Prof. or higher technical" 2 "Manager or senior admin." 3 "Clerical" 4 "Sales or services" 5 "Small business owner" 6 "Foremen or supervisor" 7 "Skilled manual" 8 "Semi & unskilled manual" 9 "Other" 10 "Never worked"
*label values class_head_grade LblClassGrade
*global keepers2005 $keepers2005 class_head_grade

gen class_resp_occ = aq58a
recode class_resp_occ 98=. 99=.
label values class_resp_occ LblClassOcc
global keepers2005 $keepers2005 class_resp_occ

gen class_spou_occ = aq58b
recode class_spou_occ -8=. -2=.
label values class_spou_occ LblClassOcc
global keepers2005 $keepers2005 class_spou_occ

gen male = aq69
recode male 1=1 2=0 9=.
global keepers2005 $keepers2005 male

gen married = aq49
recode married 1=1 2=1 3=0 4=0 5=0 6=0 8=0 99=0
global keepers2005 $keepers2005 married



gen unionmem_resp = aq51
recode unionmem_resp 1=1 2=1 3=0 8=. 9=.
global keepers2005 $keepers2005 unionmem_resp

gen unionmempast_resp = aq51a
recode unionmempast_resp 1=1 2=1 3=0 8=. 9=.
global keepers2005 $keepers2005 unionmempast_resp




// Economic perceptions

gen econ_ego_retro = bq23
recode econ_ego_retro 1/2=0 3=1 4/5=2 8 9 99=.
global keepers2005 $keepers2005 econ_ego_retro
